﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RedirectUsers.aspx.cs" Inherits="UserRedirect.Layouts.InfoSystems.RedirectUsers" DynamicMasterPageFile="~masterurl/default.master" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    <SharePoint:CssRegistration ID="CssRegistration1" Name="/_Layouts/InfoSystems/RedirectUsers.css" runat="server" After="corev4.css"/>
    <SharePoint:ScriptLink ID="jsRegistration1" Name="InfoSystems/RedirectUsers.js" runat="server" Defer="true" Localizable="false" />
</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <table class="RedirectUser-Table">
        <tbody>
            <tr>
                <td>
                    <table>
                        <tr>
                            <td>
                                <asp:Image ID="Logo" runat="server" ImageUrl="~/_layouts/images/InfoSystems/InfoSystems_48X48.png" />
                            </td>
                            <td class="RedirectUser-Title">
                                Manage User Redirection
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="RedirectUser-Category">
                     How it Works
                </td>
            </tr>
            <tr>
                <td>
                    Use this page to configure the InfoSystems User Redirection web part.  
                    <br />
                    The web part will use the settings on this page to determine what URL a user should be redirected to.  
                    <br />
                    <br />
                    <b>SharePoint Group:</b> This dropdown contains all the user groups for the top level site in the site colleciton.
                    <br />
                    <br />
                    <b>Landing Page URL:</b> This should be a relative URL that always begins with a forward slash '/'.
                    <br />
                    For example: /Subsite   or   /Library/Folder/File.aspx
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <table>
                        <tr>
                            <td class="RedirectUser-Category" colspan="2">
                                Add New Mapping
                            </td>
                        </tr>
                        <tr>
                            <td class="ms-vb RedirectUser-Blank" colspan="2">
                            </td>
                        </tr>
                        <tr>
                            <td class="ms-vb RedirectUser-Label">
                                SharePoint Group:
                            </td>
                            <td class="ms-vb RedirectUser-Value">
                                <asp:DropDownList ID="SharePointGroup" runat="server" Visible="false" />
                                <asp:Label ID="SharePointGroupLable" runat="server" Visible="false" Text="[All Groups have been assigned]" />
                            </td>
                        </tr>
                        <tr>
                            <td class="ms-vb RedirectUser-Label">
                                Landing Page URL:
                            </td>
                            <td class="ms-vb RedirectUser-Value">
                                <asp:TextBox ID="LandingPage" runat="server" Width="300px" />&nbsp;&nbsp;<a href="javascript:TestLandingPageURL()">Test Link</a>
                                <SharePoint:InputFormRequiredFieldValidator ID="LandingPage_Validator" 
                                                                            runat="server" 
                                                                            Display="Dynamic" 
                                                                            SetFocusOnError="true" 
                                                                            ControlToValidate="LandingPage" 
                                                                            BreakBefore="true"
                                                                            ErrorMessage="This is a required field." />
                                                                            
                            </td>
                        </tr>
                        <tr>
                            <td class="ms-vb RedirectUser-Link">
                                <asp:LinkButton ID="AddMapping" runat="server" Text="[Add Mapping]" OnClick="AddButton_Click" />
                            </td>
                            <td class="ms-vb RedirectUser-Link">
                                
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="RedirectUser-Category">
                    Existing Mappings
                </td>
            </tr>
            <tr>
                <td>
                    <table>
                        <tbody>
                            <tr>
                                <td class="RedirectUser-Header">
                                    
                                </td>
                                <td class="RedirectUser-Header RedirectUser-HeaderField">
                                    SharePoint Group
                                </td>
                                <td class="RedirectUser-Header RedirectUser-HeaderField">
                                    Landing Page
                                </td>
                            </tr>
                            <asp:PlaceHolder ID="RedirectUserRows" runat="server" />
                        </tbody>
                    </table>
                </td>
            </tr>                                       
        </tbody>
    </table>
</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
Manage User Redirection
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
Manage User Redirection
</asp:Content>
